package org.example.software.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.software.entity.Paint;

import java.util.List;

@Mapper
public interface PaintMapper extends BaseMapper<Paint> {
    @Select("SELECT * FROM paint WHERE id=#{id}")
    List<Paint> getPaintById(int id);

    @Select("SELECT * FROM paint WHERE manufacturer_name LIKE CONCAT('%', #{manufacturer_name}, '%')")
    List<Paint> getPaintByName(String manufacturer_name);

    @Select("SELECT * FROM paint WHERE color LIKE CONCAT('%', #{color}, '%')")
    List<Paint> getPaintByColor(String color);

    @Select("SELECT * FROM paint WHERE capacity LIKE CONCAT('%', #{capacity}, '%')")
    List<Paint> getPaintByCapacity(String capacity);
}
